home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / LanRunner_2072176232007.psc / LanRunner Mini / clsChecksum.cls < prev    next >
Text File  |  2003-06-30  |  4KB  |  160 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsIPHeader"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Option Explicit
  15.  
  16.  
  17. Private m_ver           As Byte             'IP version number
  18. Private m_len           As Byte             'header length in 32bit words (4 bits each)
  19. Private m_tos           As Byte             'Type Of Service ID (1 octet)
  20. Private m_totallength   As Integer          'Size of Datagram (header + data) in octets
  21. Private m_id            As Long             'IP-ID (16 bits)
  22. Private m_offset        As Integer          'fragmentation flags (3bit) and fragmet offset (13 bits)
  23. Private m_ttl           As Byte             'datagram Time To Live (in network hops)
  24. Private m_protocol      As Byte             'Transport protocol type (byte)
  25. Private m_checksum      As Long             'Header Checksum (16 bits)
  26. Private m_srcaddr       As Long             'Source IP Address (32 bits)
  27. Private m_destaddr      As Long             'Destination IP Address (32 bits)
  28. Private m_srcip         As String
  29. Private m_destip        As String
  30.  
  31.  
  32. Private Const DEFAULT_TTL As Long = 30
  33.  
  34.  
  35.  
  36. Public Property Get Version() As Byte
  37.     Version = m_ver
  38. End Property
  39.  
  40. Public Property Let Version(val As Byte)
  41.     m_ver = val
  42. End Property
  43.  
  44.  
  45.  
  46. Public Property Get HeaderLength() As Byte
  47.     HeaderLength = m_len
  48. End Property
  49.  
  50. Public Property Let HeaderLength(val As Byte)
  51.     m_len = val
  52. End Property
  53.  
  54.  
  55.  
  56. Public Property Get PacketLength() As Integer
  57.     PacketLength = m_totallength
  58. End Property
  59.  
  60. Public Property Let PacketLength(val As Integer)
  61.     m_totallength = val
  62. End Property
  63.  
  64.  
  65. Public Property Get Checksum() As Long
  66.     Checksum = m_checksum
  67. End Property
  68.  
  69. Public Property Let Checksum(val As Long)
  70.     m_checksum = val
  71. End Property
  72.  
  73. Public Property Get ID() As Long
  74.     ID = m_id
  75. End Property
  76.  
  77. Public Property Let ID(val As Long)
  78.     m_id = val
  79. End Property
  80.  
  81.  
  82.  
  83. Public Property Get Offset() As Integer
  84.     Offset = m_offset
  85. End Property
  86.  
  87. Public Property Let Offset(val As Integer)
  88.     m_offset = val
  89. End Property
  90.  
  91.  
  92.  
  93. Public Property Get TimeToLive() As Byte
  94.     TimeToLive = m_ttl
  95. End Property
  96.  
  97. Public Property Let TimeToLive(val As Byte)
  98.     m_ttl = val
  99. End Property
  100.  
  101.  
  102.  
  103. Public Property Get Protocol() As IPProtocol
  104.     Protocol = m_protocol
  105. End Property
  106.  
  107. Public Property Let Protocol(val As IPProtocol)
  108.     m_protocol = val
  109. End Property
  110.  
  111.  
  112.  
  113. Public Property Get SourceAddress() As Long
  114.     SourceAddress = m_srcaddr
  115. End Property
  116.  
  117. Public Property Let SourceAddress(val As Long)
  118.     m_srcaddr = val
  119.     m_srcip = GetStrIPFromLong(val)
  120. End Property
  121.  
  122.  
  123.  
  124. Public Property Get SourceIP() As String
  125.     SourceIP = m_srcip
  126. End Property
  127.  
  128. Public Property Let SourceIP(val As String)
  129.     m_srcip = val
  130. End Property
  131.  
  132.  
  133. Public Property Get TypeOfService() As Long
  134.     TypeOfService = m_tos
  135. End Property
  136.  
  137. Public Property Let TypeOfService(val As Long)
  138.     m_tos = val
  139. End Property
  140.  
  141.  
  142. Public Property Get DestAddress() As Long
  143.     DestAddress = m_destaddr
  144. End Property
  145.  
  146. Public Property Let DestAddress(val As Long)
  147.     m_destaddr = val
  148.     m_destip = GetStrIPFromLong(val)
  149. End Property
  150.  
  151.  
  152.  
  153. Public Property Get DestIP() As String
  154.     DestIP = m_destip
  155. End Property
  156.  
  157. Public Property Let DestIP(val As String)
  158.     m_destip = val
  159. End Property
  160.